<%@ page language="java" contentType="text/html; charset=UTF-8"
    import="java.util.*,kk.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">


<html>
<head> 
<meta http-equiv="Content-Type" content="text/html;charset=gbk" />
<title>新闻中国</title>
<link href="css/main.css" rel="stylesheet" type="text/css" />
<script>
	   function check(){
		var login_username = document.getElementById("uname");
		var login_password = document.getElementById("upwd");
		if(login_username.value == ""){
			alert("用户名不能为空！请重新填入！");
			login_username.focus();	
			return false;
		}else if(login_password.value == ""){
			alert("密码不能为空！请重新填入！");
			login_password.focus();
			return false;
		}
		var obj = document.getElementsByTagName("keep");
    for(var i=0; i<obj.length; i ++){
        if(obj[i].checked){
            alert(obj[i].value);
        }
    } 
		return true;
	}
	

	function focusOnLogin(){
		var login_username = document.getElementById("uname");
		login_username.focus();	
	}
	function check1(t){
	return confirm("您是确定要删除"+t+"吗?");
	}
</script>
</head>


  
 
<body>
  
<div id="header">
  <div id="top_login">
    <form action="Dologin" method="post" onsubmit="return check()">
      <label> 登录名 </label>
      <input type="text" name="uname" id="uname" value="" class="login_input" />
      <label> 密&#160;&#160;码 </label>
      <input type="password" name="upwd" id="upwd" value="" class="login_input" />
      <input type="submit" class="login_sub" value="登录" />
      <input type="checkbox" name="keep" value="1"/><lable>是否要记住您的登录状态</lable>
      <label id="error"> </label>
      <img src="images/friend_logo.gif" alt="Google" id="friend_logo" />
    </form>
  </div>
  <div id="nav">
    <div id="logo"> <img src="images/logo.jpg" alt="新闻中国" /> </div>
    <div id="a_b01"> <img src="images/a_b01.gif" alt="" /> </div>
    <!--mainnav end-->
  </div>
</div>
<div id="container">




<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<div class="sidebar">
    <h1> <img src="images/title_1.gif" alt="国内新闻" /> </h1>
    <div class="side_list">
      <ul>      
       		<%
                NewsDao ndao1=new NewsDao();
                List<News> l2=ndao1.findTop(1L);
                //System.out.print(l); 
              	for(News n3:l2){
       		 %>
       		 <li> <a href='ReadNew?nid=<%=n3.getNid()%>'><b><%=n3.getNtitle()%></b></a> </li>
       		 <%}%>
      	      	   	
      	
      </ul>
    </div>
    <h1> <img src="images/title_2.gif" alt="国际新闻" /> </h1>
    <div class="side_list">
      <ul>    
      		<%
                NewsDao ndao2=new NewsDao();
                List<News> l3=ndao2.findTop(2L);
                //System.out.print(l); 
              	for(News n3:l3){
       		 %>
       		 <li> <a href='ReadNew?nid=<%=n3.getNid()%>'><b><%=n3.getNtitle()%></b></a> </li>
       		 <%}%>  
      </ul>
    </div>
    <h1> <img src="images/title_3.gif" alt="娱乐新闻" /> </h1>
    <div class="side_list">
      <ul>
            <%
                NewsDao ndao3=new NewsDao();
                List<News> l4=ndao3.findTop(5L);
                //System.out.print(l); 
              	for(News n3:l4){
       		 %>
       		 <li> <a href='ReadNew?nid=<%=n3.getNid()%>'><b><%=n3.getNtitle()%></b></a> </li>
       		 <%}%>
      </ul>
    </div>
  </div>


 
  <div class="main">
    <div class="class_type"> <img src="images/class_type.gif" alt="新闻中心" /> </div>
    <div class="content">
      <ul class="class_date">
            
      	         
	      
	     <%--  <%
                TopicDao n4=new TopicDao();
                List<Topic> l1=n4.findAll();
                //System.out.print(l); 
                int count1=1;
              	for(Topic n3:l1){
              	if(count1==1){%><li id='class_month'><%}%>
              	<%if(count1%11==0){%></li><li id='class_month'><%}%>
              	<%count1++;%>
	      		<a href="shouye.jsp?opr=topicNew&tid=<%=n3.getTid()%>"><b><%=n3.getTname()%></b></a>	
	      	    <%} %> --%>
	      	 <%-- --%>  <%--<%
	                TopicDao n4=new TopicDao();
	                List<Topic> l1=n4.findAll();
                	request.setAttribute("l1", l1);
                %>--%>
                <li id='class_month'>
                <c:forEach var="l" items="${requestScope.l1}" varStatus="status">
                	<c:if test="${status.count==1}">
                		<li id='class_month'>
                	</c:if>
                	<c:if test="${status.count%11==0}">
                		</li><li id='class_month'>
                	</c:if>
                	<a href="Shouye?opr=topicNew&tid=${l.tid}"><b>${l.tname}</b></a>
                </c:forEach> 
      </li>	
      </ul>
      <ul class="classlist">
             <%-- <%
              	int pageNo=1;
              	try{
                	pageNo=Integer.parseInt(request.getParameter("pageNo"));
                	}
                catch(Exception e){}
                NewsDao n=new NewsDao();
                Page<News> p=null;
                String fenleiID="";
                try{
                 fenleiID=request.getParameter("tid");}
                catch(Exception e){}
                if((fenleiID!=null)){
	                Long id=Long.parseLong(fenleiID);
	                 p=n.search2(pageNo,id); 
                }
                else
                	 p=n.search1(pageNo);	 	
                int count=0;
                List<News> l=p.getDatas();--%>
                <c:forEach var="n1" items="${requestScope.l}" varStatus="status">
                	<c:if test="${status.count%4==0}">
                		<li class='space'></li>
                	</c:if>
                	<li><a href='news_control.jsp?opr=readNew&nid=${n1.nid}'>${n1.ntitle}</a><span>${n1.ncreatedate}</span></li>
                </c:forEach> 
              	<%--for(News n1:l){
              	%>
              	<%if(count%4==0){%><li class='space'></li><%}%>
              	<li><a href='news_control.jsp?opr=readNew&nid=<%=n1.getNid()%>'><%=n1.getNtitle()%></a><span><%=n1.getNcreatedate()%></span></li>
              	<%count++;%>
               <%}%> --%>
               <%--  <p>
                <a href="Shouye?pageNo=1">首页</a>
                <c:if test="${requestScope.pn==1}">
                	<a href="Shouye?pageNo=${requestScope.pn+1}">下一页</a>
                </c:if>
         		<c:if test="${requestScope.pn==requestScope.p.totalpages}">
                	<a href="Shouye?pageNo=${requestScope.pn-1}">上一页</a>
                </c:if>
                <c:if test="${requestScope.pn}>1&&${requestScope.pn}<${requestScope.p.totalpages}">
                	<a href="Shouye?pageNo=${requestScope.pn-1}">上一页</a>
                	<a href="Shouye?pageNo=${requestScope.pn+1}">下一页</a>
                </c:if>
                <a href="Shouye?pageNo=${requestScope.p.totalpages}">末页</a>
               </p>    	     	
	   			<p align="right"> 当前页数:[${requestScope.pn}/${requestScope.p.totalpages}]</p>--%>
	   			<span>现在总页数:${requestScope.p.totalpages}</span>
	   			<span>现在分类ID号:${requestScope.id}</span>
	   			<span>现在页数:${requestScope.pn}</span>
	   			<p>
	   			 <c:if test="${requestScope.p.totalpages!=0}">
                	<a href="Shouye?pageNo=1&tid=${requestScope.id}">首页</a>
               		<c:if test="${requestScope.pn==1&&requestScope.pn!=requestScope.p.totalpages}">
               		<a href="Shouye?pageNo=${requestScope.pn+1}&tid=${requestScope.id}">下一页</a>
               		</c:if>
               		<c:if test="${requestScope.pn!=1&&requestScope.pn==requestScope.p.totalpages}">
               		<a href="Shouye?pageNo=${requestScope.pn-1}&tid=${requestScope.id}">上一页</a>
               		</c:if>
             		<c:if test="${requestScope.pn>1&&requestScope.pn<requestScope.p.totalpages}">
               		<a href="Shouye?pageNo=${requestScope.pn-1}&tid=${requestScope.id}">上一页</a>
                	<a href="Shouye?pageNo=${requestScope.pn+1}&tid=${requestScope.id}">下一页</a>
               		</c:if>
               		<a href="Shouye?pageNo=${requestScope.p.totalpages}&tid=${requestScope.id}">末页</a>
                	 </p>
               </c:if>
               <c:if test="${requestScope.pn>requestScope.p.totalpages}">
                	${requestScope.pn=requestScope.p.totalpages}
                </c:if>
               <%--
               if(pageNo>p.getTotalpages())
               pageNo=p.getTotalpages();
                --%>   	     	
	   			<p align="right"> 当前页数:[${requestScope.pn}/${requestScope.p.totalpages}]</p> 	
             <%--   <p>
                <a href="shouye.jsp?pageNo=1">首页</a>
                <%if(pageNo==1){%>
                 <a href="shouye.jsp?pageNo=<%=pageNo+1%>">下一页</a>
                <%}%>
             	<%if(pageNo==p.getTotalpages()){%>
               <a href="shouye.jsp?pageNo=<%=pageNo-1%>">上一页</a>
               <%}%>
               <%if(pageNo>1&&pageNo<p.getTotalpages()){%>
                <a href="shouye.jsp?pageNo=<%=pageNo-1%>">上一页</a>
                <a href="shouye.jsp?pageNo=<%=pageNo+1%>">下一页</a>
               <%}%>
                <a href="shouye.jsp?pageNo=<%=p.getTotalpages()%>">末页</a>
               </p>    	     	
	   			<p align="right"> 当前页数:[<%=pageNo%>/<%=p.getTotalpages()%>]</p> --%>		
      </ul>
    </div>   
<div class="picnews">
  <ul>
    <li> <a href="#"><img src="images/Picture1.jpg" width="249" alt="" /> </a><a href="#">幻想中穿越时空</a> </li>
    <li> <a href="#"><img src="images/Picture2.jpg" width="249" alt="" /> </a><a href="#">国庆多变的发型</a> </li>
    <li> <a href="#"><img src="images/Picture3.jpg" width="249" alt="" /> </a><a href="#">新技术照亮都市</a> </li>
    <li> <a href="#"><img src="images/Picture4.jpg" width="249" alt="" /> </a><a href="#">群星闪耀红地毯</a> </li>
  </ul>
</div>
  </div>
</div>
  <div id="friend">
  <h1 class="friend_t"> <img src="images/friend_ico.gif" alt="合作伙伴" /> </h1>
  <div class="friend_list">
    <ul>
      <li> <a href="#">百度</a> </li>
      <li> <a href="#">谷歌</a> </li>
      <li> <a href="#">新浪</a> </li>
      <li> <a href="#">网易</a> </li>
      <li> <a href="#">搜狐</a> </li>
      <li> <a href="#">人人</a> </li>
      <li> <a href="#">中国政府网</a> </li>
    </ul>
  </div>
</div>
<div id="footer">
  <p class=""> 24小时客户服务热线：010-68988888 &#160;&#160;&#160;&#160; <a href="#">常见问题解答</a> &#160;&#160;&#160;&#160; 新闻热线：010-627488888 <br />
    文明办网文明上网举报电话：010-627488888 &#160;&#160;&#160;&#160; 举报邮箱： <a href="#">jubao@jb-aptech.com.cn</a> </p>
  <p class="copyright"> Copyright &copy; 1999-2009 News China gov, All Right Reserver <br />
    新闻中国 版权所有 </p>
</div>
</body>
</html>
</body>

</html>
